package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.domain.bank.Account;

public class BankService
{
	public static void addClient(final Bank curBank, final Client newClient)
	{
		curBank.addClient(newClient);
	}
	
	public static void printMaximumAmountToWithdraw(final Bank curBank)
	{
		Client[] curClients = curBank.getClients();
		for (int i = 0; i < curBank.getNumberOfClients(); i++)
		{
			System.out.println("\nClient #" + i);
			System.out.println(curClients[i].getClientSalutation());
			Account[] curClientAccounts = curClients[i].getAccounts();
			for (int j = 0; j < curClients[i].getNumberOfAccounts(); j++)
			{
				System.out.println("ID: " + curClientAccounts[0].getID() + 
						"\tMaximum amount to withdraw: " + 
						curClientAccounts[0].maximumAmountToWithdraw());
			}
		}
	}
}
